/*
 * Copyright 2006 Matt Jensen
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations under the License.
 */
package org.spectaql.internal;

import org.spectaql.metadata.PersistenceMetadata;

/**
 * <p>
 * <code>SpectaqlContextInternal</code> defines the internal interface to a Spectaql context. It defines methods which
 * are used internally in the process of building dynamic queries.
 * </p>
 * <p>
 * <strong>The methods defined by this interface should not be accessed by the client application.</strong>
 * </p>
 */
public interface SpectaqlContextInternal
{
    /**
     * <p>
     * Create an entity proxy instance which implements the internal interface of a given handler.
     * </p>
     *
     * @param entityClass the entity class.
     * @param internalHandler the handler whose interface is mixed into the proxy, and to which all method invocations
     * on that interface are delegated.
     * @return {@link Object} proxy instance.
     */
    <T> T createProxy(Class<T> entityClass, Object internalHandler);
    
    /**
     * <p>
     * Get the persistence metadata.
     * </p>
     *
     * @return {@link PersistenceMetadata} instance.
     */
    PersistenceMetadata getPersistenceMetadata();

    /**
     * <p>
     * Determine whether a given class represents a mapped entity class.
     * </p>
     *
     * @param clazz the class.
     * @return <code>boolean</code> indicating whether <code>clazz</code> is a mapped entity class.
     */
    boolean isEntityClass(Class<?> clazz);
}
